<?php

class ActionLogout extends BaseAction
{
    public function run()
    {
        $this->isRender = false;
        
        $bIsAdmin = Yii::app()->user->isAdmin();
        
        Yii::app()->user->logout();
        
	    if ($bIsAdmin) 
            {
                    Yii::app()->controller->redirect(Yii::app()->controller->createUrl('/login'));
            }
            else
            {
                    Yii::app()->controller->redirect('/');
            }
    }
}